pp108 : listDirectories (FTP)

listDirectories (FTP)


This Web service operation is used to list files or folders from different directories on the FTP Server.

SOAP Request

The recursive attribute is set to true.

<SOAP:Envelope xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/">
    <SOAP:Body>
        <listDirectories xmlns="http://schemas.cordys.com/ftpconnector/1.1">
            <configuration>ftpserver</configuration>
            <directory>
                <path recursive="true">/</path>
            </directory>
        </listDirectories>
    </SOAP:Body>
</SOAP:Envelope>

Request Parameters

Tags Description
configuration Name of the Configuration Profile that contains the FTP server details.
directory Contains the paths of the directories from where the files are to be listed.
path The path of a directory on the FTP server.


SOAP Response
<listDirectoriesResponse
    xmlns="http://schemas.cordys.com/ftpconnector/1.1" xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/">
    <configuration xmlns="http://schemas.cordys.com/ftpconnector/1.1" xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/">ftpserver</configuration>
    <directory xmlns="http://schemas.cordys.com/ftpconnector/1.1" xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/">
        <path recursive="true">/
        <listOfFiles xmlns="http://schemas.cordys.com/1.0/ftp">
                <dir path="/">
                    <listOfFiles>
                        <file>Development</file>
                        <file>HR</file>
                        <file>Legal</file>
                        <statuscode>226</statuscode>
                        <status>Transfer complete.</status>
                    </listOfFiles>
                </dir>
                <dir path="Development">
                    <listOfFiles>
                        <file>license.txt</file>
                        <statuscode>226</statuscode>
                        <status>Transfer complete.</status>
                    </listOfFiles>
                </dir>
                <dir path="HR">
                    <listOfFiles>
                        <file>employeesList.xls</file>
                        <statuscode>226</statuscode>
                        <status>Transfer complete.</status>
                    </listOfFiles>
                </dir>
                <dir path="Legal">
                    <listOfFiles>
                        <file>leagal.txt</file>
                        <statuscode>226</statuscode>
                        <status>Transfer complete.</status>
                    </listOfFiles>
                </dir>
            </listOfFiles>
        </path>
    </directory>
</listDirectoriesResponse>

SOAP Request

The recursive attribute is set to false.

<SOAP:Envelope xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/">
    <SOAP:Body>
        <listDirectories xmlns="http://schemas.cordys.com/ftpconnector/1.1">
            <configuration>ftpserver</configuration>
            <notification-subject>FTP</notification-subject>
            <directory>
                <path recursive="false">/</path>
            </directory>
        </listDirectories>
    </SOAP:Body>
</SOAP:Envelope>

SOAP Response
<listDirectoriesResponse
    xmlns="http://schemas.cordys.com/ftpconnector/1.1" xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/">
    <configuration xmlns="http://schemas.cordys.com/ftpconnector/1.1" xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/">ftpserver</configuration>
    <notification-subject
        xmlns="http://schemas.cordys.com/ftpconnector/1.1" xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/">FTP</notification-subject>
    <directory xmlns="http://schemas.cordys.com/ftpconnector/1.1" xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/">
        <path recursive="false">/
        <listOfFiles xmlns="http://schemas.cordys.com/1.0/ftp">
                <file>Development</file>
                <file>HR</file>
                <file>Legal</file>
                <statuscode>226</statuscode>
                <status>Transfer complete.</status>
            </listOfFiles>
        </path>
    </directory>
</listDirectoriesResponse>